package localqueue

var c  map[string]chan map[string]string

func init() {
	c = make(map[string]chan map[string]string, 100)
}

func NewQueue(pueueName string, max int) error {
	c[pueueName] = make(chan map[string]string, max)
	return nil
}

func Read(pueueName string) map[string]string {
	return <-c[pueueName]
}

func Write(pueueName string, msg map[string]string) {
	c[pueueName] <- msg
}